﻿<!DOCTYPE html>
<html lang="en">
<head profile="http://a9.com/-/spec/opensearch/1.1/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="./site.css" rel="stylesheet">
<title>crypto/aes</title>
</head>
<body>
<div class="container">
    <h2 id="pkg-overview">package aes</h2>
    <p><code>import "crypto/aes"</code>
    <p>aes包实现了AES加密算法，参见U.S. Federal Information Processing Standards Publication 197。</p>
    <h3 id="pkg-index" class="section-header">Index <a class="permalink" href="#pkg-index">&para;</a></h3>
    <ul class="list-unstyled">
        <li><a href="#pkg-constants">Constants</a></li>
        <li><a href="#KeySizeError">type KeySizeError</a></li>
        <ul>
            <li><a href="#KeySizeError.Error">func (k KeySizeError) Error() string</a></li>
        </ul>
        <li><a href="#NewCipher">func NewCipher(key []byte) (cipher.Block, error)</a></li>
    </ul>
    <h3 id="pkg-constants">Constants <a class="permalink" href="#pkg-constants">&para;</a></h3>
    <pre>const <span id="BlockSize">BlockSize</span> = 16</pre>
    <p>AES字节块大小。</p>
    <h3 id="KeySizeError">type <a title="View Source" href="http://code.google.com/p/go/source/browse/src/pkg/crypto/aes/cipher.go?name=release#21">KeySizeError</a> <a class="permalink" href="#KeySizeError">&para;</a></h3>
    <pre>type KeySizeError <a href="https://godoc.org/builtin#int">int</a></pre>
    <h4 id="KeySizeError.Error">func (KeySizeError) <a title="View Source" href="http://code.google.com/p/go/source/browse/src/pkg/crypto/aes/cipher.go?name=release#23">Error</a> <a class="permalink" href="#KeySizeError.Error">&para;</a></h4>
    <pre class="funcdecl">func (k <a href="#KeySizeError">KeySizeError</a>) Error() <a href="https://godoc.org/builtin#string">string</a></pre>
    <h3 id="NewCipher">func <a title="View Source" href="http://code.google.com/p/go/source/browse/src/pkg/crypto/aes/cipher.go?name=release#31">NewCipher</a> <a class="permalink" href="#NewCipher">&para;</a></h3>
    <pre class="funcdecl">func NewCipher(key []<a href="https://godoc.org/builtin#byte">byte</a>) (<a href="https://godoc.org/crypto/cipher">cipher</a>.<a href="https://godoc.org/crypto/cipher#Block">Block</a>, <a href="https://godoc.org/builtin#error">error</a>)</pre>
    <p>创建一个cipher.Block接口。参数key为密钥，长度只能是16、24、32字节，用以选择AES-128、AES-192、AES-256。</p>
</div>
</body>
</html>
